package fst.parsing

trait StringParsers extends Parsers {
  type Input = String
  type Elem = Char
  val EOI = 0.toChar

  implicit def InputIsParseInput(s: Input) = new ParseInput { val self = s 
  	def first: Elem = if(atEnd) EOI else self(0)
  	def rest: Input = if(atEnd) self else self.substring(1)
  	def atEnd = self == ""
    def laterThan(o: String) = self.length < o.length
	}
  
  def eoi = accept(EOI)
}